import Link from "next/link"; import type { Metadata } from "next"; import { Timeline } from "@/components/timeline"; import { Chip, Empty, PageHeader, Panel, Table, Td } from "@/components/ui"; import { api } from "@/lib/api"; import { relTime } from "@/lib/format"; export const dynamic = "force-dynamic"; export async function generateMetadata({ params }: { params: Promise<{ domain: string }> }): Promise { const { domain } = await params; return { title: `${domain} โ€” domain timeline`, description: `Monitored URLs and detected changes on ${domain}.`, alternates: { canonical: `/domain/${domain}` } }; } export default async function DomainPage({ params, searchParams }: { params: Promise<{ domain: string }>; searchParams: Promise<{ cursor?: string }> }) { const { domain } = await params; const { cursor } = await searchParams; const d = await api.domain(domain, cursor); return ( <> {domain}} description="Every monitored URL on this domain with its history, plus the event timeline." actions={d?.source_id ? Source page โ†’ : undefined} />
{d?.urls.length ? ( {d.urls.map((u) => ( ))}
{u.url.replace(/^https?:\/\//, "")} {u.status} {u.snapshot_count} {u.change_count} {relTime(u.last_seen_at)}
) : ( No URLs monitored on this domain yet. )}
{d?.nextCursor && (
Older โ†’
)}
); }